import { useABI_airdrop_Cpntract } from '../contacthelp/useContract.js'

export async function claimAmount({ library, account, contractAddress }) {
  const contract = useABI_airdrop_Cpntract(library, account, contractAddress, true)
  const info = await contract.getClaimAmount(account)
  return info
}

export async function getClaim({ library, account, contractAddress }) {
  const contract = useABI_airdrop_Cpntract(library, account, contractAddress, true)
  const status = await contract.status()
  if (status == 0) {
    throw new Error("claim function has not been activated, please wait patiently");
  }
  const info = await contract.claim()
  return info
}

export async function getContractStatus({ library, account, contractAddress }) {
  const contract = useABI_airdrop_Cpntract(library, account, contractAddress, true)
  const info = await contract.status()
  return info
}
